def zhuce():
    global ID
    ID = (input("请输入ID地址:"))
    if idcheck(ID):
        print("输入成功")
    else:
        print("输入错误，请重新输入")

    global Emall
    Emall= input("请输入EMALL地址:")
    if emallcheck(Emall):
        print("地址合法")
    else:
        print("地址不合法")

    global CardId
    CardId=input("请输入身份证号:")
    if len(CardId)==18:
        print("输入正确")
    else:
        print("输入错误")

    global Name
    Name=(input("请输入姓名"))

    global Sex
    Sex=int(CardId[-2:-1])
    if Sex % 2==0:
        Sex='女'
        print("性别：女")
    else:
        Sex='男'
        print("性别：男")

def idcheck(ID):
    if len(ID)>8 or len(ID)==0:
        return False
    if '_' in ID:
        x=ID.replace('_','x')
        if x.isalnum():
            return True
    return True

def emallcheck(Emall):
    if '@' not in Emall or '.' not in Emall:
        return False
    if len(Emall[0:Emall.index('@')])==0:
        return False
    if len(Emall[Emall.index('.')+1:])==0:
        print(len(Emall[-1:Emall.index('.')]))
        return False
    return True

zhuce()

def out(a,b):
    print("{0:<10}{1:<20}".format(a,b))

print("#"*40)
out("ID:",ID)
out("Emall:",Emall)
out("CardId:",CardId)
out("Name:",Name)
out("Sex:",Sex)